package com.ddtech.framework.system.utils;

import java.util.Random;

/**
 * @version v1.0
 * @ClassName:RandomStringGenerator description：
 * @author:wei_zhang(xiao)
 * @date: 2024-12-05 15:58
 */
public class RandomStringGenerator {

    private RandomStringGenerator(){};

    public static String generateRandomString() {
        Random random = new Random();
        String randomNumber = (random.nextInt(100000) + 1) + "";
        if(randomNumber.length()==1){
            randomNumber="0000"+randomNumber;
        }else if(randomNumber.length()==2){
            randomNumber="000"+randomNumber;
        }else if(randomNumber.length()==3){
            randomNumber="00"+randomNumber;
        }else if(randomNumber.length()==4){
            randomNumber="0"+randomNumber;
        }
        return  randomNumber;
    }

    public static void main(String[] args) {
        String randomString = generateRandomString();
        System.out.println(randomString);
    }
}
